package com.yunyun400.vosk.entity;

import java.util.Date;

/**
 * 外呼记录实体类
 * 用于存储每次外呼的详细信息和结果
 */
public class CallRecord {
    
    /**
     * 外呼状态枚举
     */
    public enum CallStatus {
        PENDING,    // 待外呼
        RINGING,    // 振铃中
        ANSWERED,   // 已接听
        FAILED,     // 失败
        HANGUP      // 已挂断
    }
    
    private String id;              // 记录ID
    private String phoneNumber;     // 被叫号码
    private String callerId;        // 主叫号码
    private String sessionId;       // 会话ID
    private Date callTime;          // 外呼时间
    private Date answerTime;        // 接通时间
    private Date endTime;           // 结束时间
    private CallStatus status;      // 通话状态
    private String hangupCause;     // 挂断原因
    private String result;          // 外呼结果
    private String batchId;         // 批次ID，用于标识同一批外呼
    
    // 构造函数
    public CallRecord() {
        this.status = CallStatus.PENDING;
        this.callTime = new Date();
    }
    
    // Getters and Setters
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getPhoneNumber() {
        return phoneNumber;
    }
    
    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }
    
    public String getCallerId() {
        return callerId;
    }
    
    public void setCallerId(String callerId) {
        this.callerId = callerId;
    }
    
    public String getSessionId() {
        return sessionId;
    }
    
    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }
    
    public Date getCallTime() {
        return callTime;
    }
    
    public void setCallTime(Date callTime) {
        this.callTime = callTime;
    }
    
    public Date getAnswerTime() {
        return answerTime;
    }
    
    public void setAnswerTime(Date answerTime) {
        this.answerTime = answerTime;
    }
    
    public Date getEndTime() {
        return endTime;
    }
    
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    
    public CallStatus getStatus() {
        return status;
    }
    
    public void setStatus(CallStatus status) {
        this.status = status;
    }
    
    public String getHangupCause() {
        return hangupCause;
    }
    
    public void setHangupCause(String hangupCause) {
        this.hangupCause = hangupCause;
    }
    
    public String getResult() {
        return result;
    }
    
    public void setResult(String result) {
        this.result = result;
    }
    
    public String getBatchId() {
        return batchId;
    }
    
    public void setBatchId(String batchId) {
        this.batchId = batchId;
    }
    
    @Override
    public String toString() {
        return "CallRecord{" +
                "id='" + id + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", callerId='" + callerId + '\'' +
                ", sessionId='" + sessionId + '\'' +
                ", callTime=" + callTime +
                ", answerTime=" + answerTime +
                ", endTime=" + endTime +
                ", status=" + status +
                ", hangupCause='" + hangupCause + '\'' +
                ", result='" + result + '\'' +
                ", batchId='" + batchId + '\'' +
                '}';
    }
}